package Database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JOptionPane;

public class SolutionModified 
{
	String title;
	String text;
	public SolutionModified(int num)
	{
		try{
			Class.forName("com.mysql.jdbc.Driver");
			Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/bmi","root","1234"); 
			Statement statement = con.createStatement();
			ResultSet rs = statement.executeQuery("select * from modified where num = '" + num + "'");
            if (rs.next()) {
            	title = rs.getString(2);
            	text = rs.getString(3);
            }
			statement.close();
			con.close();
		}catch (Exception e) 
		{
			JOptionPane.showMessageDialog(null,e);
		}
	}
	public String getTitle()
	{
		return title;
	}
	public String getText()
	{
		return text;
	}
	
	
}
